<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/assets/css/bootstrap.css" rel="stylesheet">
    <script src="/assets/js/jquery.min.js"></script>
    <script src="/assets/js/browser.js"></script>
    <script src="/assets/js/bootstrap.js"></script>
    <script src="/assets/js/front.js"></script>
    <link href="/assets/css/custom.css" rel="stylesheet">
    <link href="/assets/css/style.css" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="/assets/ckplayer/css/ckplayer.css">
    <script type="text/javascript" charset="utf-8" src="/assets/ckplayer/js/ckplayer.js"></script>
    <title>首页</title>
</head>
<body>
    <div class="head">
    <div class="nav">
        <ul class="nav_body">
            <li><a href="/">首页</a></li>
            <li><a class="current" href="master-lecture">名家讲堂</a></li>
            <li><a href="master">名家风采</a></li>

            <li><a href="video">往期视频</a></li>
        </ul>
    </div>
    </div>
    <div class="main">
        <div><br/><br/></div>
        <div class="online">
            <div class="online_class">
                <div class="online_class_bg"><img src="assets/images/last_time_bg.jpg" /></div>
                <div class="online_class_body">
                    @if(isset($zVideo[0]))
                        <!--会议进行中-->
                            <?php $video=$zVideo[0]?>
                        <input type="hidden" id="url" value="{{$zVideo[0]->url}}">
                        <div class="meeting">
                            <a href="javascript:void(show2())">
                                <img src="/assets/images/online_classing.png" />
                            </a>
                        </div>
                    @elseif(isset($qVideo[0]))
                            <?php $video=$qVideo[0]?>
                        <div class="before" >
                            <div class="last_time_big" >
                                <span class="time1"></span>
                                <span class="time2"></span>
                                <span class="time3"></span>
                                <span class="time4"></span>
                            </div>
                            <a class="class_href" href="#"></a>
                        </div>
                    @elseif(isset($oVideos[0]))
                        <!--会议结束-->
                            <?php $video=$oVideos[0]?>
                        <div class="end_title">会议已结束</div>
                    @else
                            <?php $video=''?>
                        <div class="end_title">暂时没有会议</div>
                    @endif
                    <?php
                    if($video!='') {
                        include("./phpqrcode/phpqrcode.php");
                        function getQRcode($data, $outfile)
                        {
                            $Qrcode = new QRcode();
                            $Qrcode->png($data, $outfile, 'L', 10);//前两个参数：文字（二维码的内容） 输出路径
                        }

                        $data = $video->url;
                        $outfile = './assets/images/shouye.png';
                        getQRcode($data, $outfile);
                    }
                    ?>
                    @if(isset($qVideo[0]))
                        <div class="online_export_box">
                            <div class="online_export_bg"></div>
                            <div class="online_export clearfix">
                                <div class="online_export_ship">
                                    <div class="online_export_img">
                                        <a href="/expert/expert-info/{{$video->Comment[0]->id}}"><img src="{{$video->comment[0]->img}}" /></a>
                                    </div>
                                    <div class="online_export_txt">
                                        <p>专家：{{$video->comment[0]->name}}  {{$video->comment[0]->zhiwu}}</p>
                                        <p>医院：{{$video->comment[0]->hospital}}</p>
                                        <p>科室：{{$video->comment[0]->keshi}}</p>
                                        <p>职称：{{$video->comment[0]->zhicheng}}</p>
                                    </div>
                                </div>
                                <!--课程简介-->
                                <div class="online_export_ship border_left">
                                    <div class="online_export_intro">
                                        <p><b>课程简介</b></p>
                                        <p>{{$video->show}}</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    @endif
                </div>
                @if(isset($qVideo[0])||isset($zVideo[0]))
                    <div class="online_class_share">
                        <span>分享到：</span>
                        <a href="javascript:void(show())"><img src="/assets/images/icon_weixin.jpg" /></a>
                    </div>
                @endif
            </div>
        </div>
    </div>
    <div class="shadow" id="shadow" style="display:none"></div>
    <div class="chat_pop" style="display:none" id="chat_pop">
        <div class="chat_pop_top"><a href="javascript:void(hide())" class="chat_pop_close"></a></div>
        <div class="chat_pop_body">
            <img src="/assets/images/shouye.png" />
            <p>使用微信扫一扫，并将网页分享给好友</p>
        </div>
    </div>
    <!-- 姓名输入弹出框 -->
    <div id="name_pop" class="export_pop" style="display:none">
        <div class="export_pop_top">
            <span>提示</span>
            <a href="javascript:hide2()" class="export_pop_close"></a>
        </div>
        <div class="export_pop_body">
            <div>请输入您的姓名：</div>
            <div class="export_name_input"><input id="nick_name" type="text" /></div>
            <div class="export_name_submit"><input type="button" class="btn blue_btn" value="确定" onclick="join_meeting()"/></div>
        </div>
    </div>
    <script>
        var time1 = document.querySelector(".time1");
        var time2 = document.querySelector(".time2");
        var time3 = document.querySelector(".time3");
        var time4 = document.querySelector(".time4");
        //获取截止时间的时间戳（单位毫秒）
        var inputTime = +new Date("<?php if(isset($qVideo[0])) echo ($qVideo[0]->begin_time)?>");
        var outTime = +new Date("<?php if(isset($zVideo[0])) echo ($zVideo[0]->end_time)?>");

        //我们先调用countDown函数，可以避免在打开界面后停一秒后才开始倒计时
        countDown();
        //定时器 每隔一秒变化一次
        setInterval(countDown, 1000);
        function countDown() {
            //获取当前时间的时间戳（单位毫秒）
            var nowTime = +new Date();
            //把剩余时间毫秒数转化为秒
            var times = (inputTime - nowTime) / 1000;
            var timess = (outTime - nowTime) / 1000;
            //计算小时数 转化为整数
            if(parseInt(times)>=0) {
                var d = parseInt(times / 60 / 60 / 24);
                //如果小时数小于 10，要变成 0 + 数字的形式 赋值给盒子
                time1.innerHTML = d;
                var h = parseInt(times / 60 / 60 % 24);
                //如果小时数小于 10，要变成 0 + 数字的形式 赋值给盒子
                time2.innerHTML = h < 10 ? "0" + h : h;
                //计算分钟数 转化为整数
                var m = parseInt(times / 60 % 60);
                //如果分钟数小于 10，要变成 0 + 数字的形式 赋值给盒子
                time3.innerHTML = m < 10 ? "0" + m : m;
                //计算描述 转化为整数
                var s = parseInt(times % 60);
                //如果秒钟数小于 10，要变成 0 + 数字的形式 赋值给盒子
                time4.innerHTML = s < 10 ? "0" + s : s;
                if(parseInt(times) == 0) location.reload(1);
            }
            if(parseInt(timess)==0) location.reload(1);
        }
    </script>
</body>
</html>
